﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="EditProfile.aspx.cs" Inherits="Private.EditProfile" Title="Edit profile"
    ViewStateMode="Disabled" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePartialRendering="true"
        CombineScripts="true" CombineScriptsHandlerUrl="~/HttpHandlers/CombineScriptsHandler.ashx" />
    <br />
    <br />
    <asp:Panel ID="pnlMain" runat="server" Visible="false">
        <asp:Panel ID="pnlAdmin" runat="server" Visible="false">
            <asp:Button ID="btnDeleteUser" runat="server" Text="Delete user" OnClick="btnDeleteUser_Click"
                OnClientClick="return confirm('Delete user?')" CausesValidation="false" />
            &nbsp;&nbsp;
            <asp:Button ID="btnDeactivateUser" runat="server" Text="Deactivate user" OnClick="btnDeactivateUser_Click"
                OnClientClick="return confirm('Deactivate user?')" CausesValidation="false" />
            <asp:Button ID="btnActivateUser" runat="server" Text="Activate user" OnClick="btnActivateUser_Click"
                OnClientClick="return confirm('Activate user?')" CausesValidation="false" />
            <br />
            <br />
            User is currently
            <asp:Label ID="lbIsActive" runat="server"></asp:Label>
            <br />
            <br />
            User roles:
            <asp:Panel ID="pnlRoles" runat="server">
            </asp:Panel>
            <br />
            <asp:Button ID="btnSaveRoles" runat="server" Text="Save roles" OnClick="btnSaveRoles_Click"
                CausesValidation="false" />
            <br />
            <asp:Label ID="lbUserStatus" runat="server" ForeColor="Red" Visible="false"></asp:Label>
            <br />
            <br />
        </asp:Panel>
        Change profile information for user
        <asp:Label ID="lbUsername" runat="server"></asp:Label>
        <br />
        <br />
        <br />
        <ajaxToolkit:TabContainer ID="tbProfileInfo" runat="server" ActiveTabIndex="0" CssClass="custom-tab-style"
            OnActiveTabChanged="tbProfileInfo_ActiveTabChanged" AutoPostBack="true">
            <ajaxToolkit:TabPanel ID="tpProfileInformation" runat="server" HeaderText="Personal Information">
                <HeaderTemplate>
                    Personal Information
                </HeaderTemplate>
                <ContentTemplate>
                    <br />
                    First name:
                    <br />
                    <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
                    <br />
                    Last name:
                    <br />
                    <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>
                    <br />
                    Birth date:
                    <br />
                    <asp:TextBox ID="txtBirthDate" runat="server"></asp:TextBox>
                    <br />
                    Website:
                    <br />
                    <asp:TextBox ID="txtWebsite" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="revWebsite" runat="server" ControlToValidate="txtWebsite"
                        ErrorMessage="Invalid website" ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?">*</asp:RegularExpressionValidator>
                    <br />
                    <br />
                    Show in public profile:
                    <br />
                    <asp:CheckBox ID="cbNamesPublic" runat="server" />
                    Names
                    <br />
                    <asp:CheckBox ID="cbBirthDatePublic" runat="server" />
                    Birth Date
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel ID="tpContactInformation" runat="server" HeaderText="Contact Information">
                <ContentTemplate>
                    <br />
                    MSN:
                    <br />
                    <asp:TextBox ID="txtMSN" runat="server"></asp:TextBox>
                    <br />
                    ICQ:
                    <br />
                    <asp:TextBox ID="txtICQ" runat="server"></asp:TextBox>
                    <br />
                    <br />
                    <asp:CheckBox ID="cbContactInfoPublic" runat="server" />
                    Show in public profile.
                    <br />
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel ID="tpAccountSettings" runat="server" HeaderText="Account Settings">
                <ContentTemplate>
                    <br />
                    Current password (required for password change, e-mail and secret question change):
                    <br />
                    <asp:TextBox ID="txtCurrentPassword" runat="server" TextMode="Password"></asp:TextBox>
                    <br />
                    <br />
                    New password:
                    <br />
                    <asp:TextBox ID="txtNewPassword" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="revNewPassword" runat="server" ControlToValidate="txtNewPassword">*</asp:RegularExpressionValidator>
                    <br />
                    Confirm password:
                    <br />
                    <asp:TextBox ID="txtNewPasswordConfirm" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="revNewPasswordConfirm" runat="server" ControlToValidate="txtNewPasswordConfirm">*</asp:RegularExpressionValidator>
                    <br />
                    <br />
                    E-mail:
                    <br />
                    <asp:TextBox ID="txtNewEmail" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="revNewEmail" runat="server" ControlToValidate="txtNewEmail"
                        ErrorMessage="Invalid e-mail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                    <br />
                    <br />
                    New secret question:
                    <br />
                    <asp:TextBox ID="txtNewSecretQuestion" runat="server"></asp:TextBox>
                    <br />
                    New secret answer:
                    <br />
                    <asp:TextBox ID="txtNewSecretAnswer" runat="server"></asp:TextBox>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
        </ajaxToolkit:TabContainer>
        <br />
        <asp:UpdatePanel ID="upProfile" runat="server" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="tbProfileInfo" EventName="ActiveTabChanged" />
            </Triggers>
            <ContentTemplate>
                <asp:Label ID="lbError" runat="server" Visible="false" ForeColor="Red"></asp:Label>
                <br />
                <asp:ValidationSummary ID="vs1" runat="server" />
                <br />
                <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>
    <asp:Panel ID="pnlDenied" runat="server">
        You are not authorized to view this page.
    </asp:Panel>
</asp:Content>
